<%@page import="bean.ELClass"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jstl_out.jsp</title>
</head>
<body>
<%
	String str = "abcde1234홍길동";
	String html = "<font color='#ff0000'>하하하</font>";
	request.setAttribute("a", str);
	request.setAttribute("html", html);
%>
	<ul>
		<li>a = <c:out value="${a }" default="^^"/></li>
		<li>b = <c:out value="${b }" default="^^"/></li>
		<li>html = <c:out value="${html }" escapeXml="true"/></li>
		<li>html = <c:out value="${html }" escapeXml="false"/></li>
	</ul>
	<!-- 빈 태그를 사용하는 경우 -->
	<jsp:useBean id="bean" class="bean.ELClass" scope="page"/>
	<c:set target="${bean }" property="mid" value="hello"/>
	<c:set target="${bean }" property="pwd" value="12345"/>
	
	<ul>
		<li>mid = ${bean.mid }</li>
		<li>pwd = ${bean.pwd }</li>
		<li>c:out = <c:out value="${bean.mid }"/></li>
		<li>c:out = <c:out value="${bean.pwd }"/></li>
	</ul>
	
	<!-- 일반 객체를 선언하는 경우 -->
	<h2>일반 객체 선언 후 set 사용</h2>
	<%
		bean.ELClass el = new ELClass();
		pageContext.setAttribute("el", el);
	%>
	<c:set target="${el }" property="mid" value="hello"/>
	<c:set target="${el }" property="pwd" value="12345"/>
	
	<%
		out.print("<li>mid= "+el.getMid());
	%>
	<ul>
		<li>pwd= ${el.mid }</li>
	</ul>
</body>
</html>